package cn.itsource.autoconfigure;

import cn.itsource.config.CosProperties;
import cn.itsource.core.CosTemplate;
import cn.itsource.core.GetCosClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(value = CosProperties.class)
public class CosAutoConfiguration {

    @Bean
    public GetCosClient getCosClient(CosProperties cosProperties){
        return new GetCosClient(cosProperties);
    }
    @Bean
    public CosTemplate getCosTemplate(GetCosClient getCosClient,CosProperties cosProperties){
        return new CosTemplate(cosProperties,getCosClient);
    }
}
